import React, {Component} from 'react';
import {Route} from 'react-router-dom'
import {BrowserRouter, Switch} from 'react-router-dom'
import Admin from './Admin'
import Home from '@/pages/Home'
import NoMatch from '@/pages/NoMatch'
import InterfaceMode from '@/pages/BasicSet/InterfaceMode'
import Login from '@/components/Login'
import App from './App'

class Router extends Component {
    render() {
        return (
            <BrowserRouter>
                <App>
                    <Switch>
                        <Route exact path='/login' component={Login}/>
                        <Route path='/' render={() =>
                            <Admin>
                                <Switch>
                                    <Route  exact path='/' component={Home}/>
                                    <Route  exact path='/home' component={Home}/>
                                    <Route exact path='/basicSet/interfaceMode' component={InterfaceMode}/>
                                    <Route component={NoMatch}/>
                                </Switch>
                            </Admin>
                        }/>
                    </Switch>
                </App>
            </BrowserRouter>
        );
    }
}

export default Router;
